package engine.network.hostSide;

import java.io.IOException;
import java.net.Socket;
import java.net.SocketTimeoutException;

import engine.network.hostSide.abstractClasses.ServerSocketHandler;
import engine.network.hostSide.mp.MultiPlayerHandling;

public class BasicServer extends ServerSocketHandler {
	/* *********************************************************
	 * Attributes
	 * ********************************************************* */
	private MultiPlayerHandling _multi;
	
	/* *********************************************************
	 * Constructor(s)
	 * ********************************************************* */
	public BasicServer(int port) {
		super(port);
		_multi = new MultiPlayerHandling();
		this.start();
	}

	@Override
	protected void whileRunning() throws IOException, SocketTimeoutException {
		Socket s = _svrSock.accept();
		System.out.println("BasicSvr: new incomming connection");
		_multi.handleNewConnexion(s);
	}

}
